log using Replication_main_log, replace

********************************************************************************************************************************************************************************************
*This is the code to replicate the results of the article "Voters rally around the incumbent in the aftermath of terrorist attacks: Evidence from multiple unexpected events during surveys"
*Read the README.txt file first
*February 18, 2025
********************************************************************************************************************************************************************************************

***************************************
use multipleuesd_terror_data.dta, clear
***************************************

quietly {
	global good30_pre7 if inrange(reldate,-30,30) & pretreat7==0 & idate!=.
	global good20_pre7 if inrange(reldate,-20,20) & pretreat7==0 & idate!=.
	global good10_pre7 if inrange(reldate,-10,10) & pretreat7==0 & idate!=.
	global good5_pre7 if inrange(reldate,-5,5) & pretreat7==0 & idate!=.
	global good3_pre7 if inrange(reldate,-3,3) & pretreat7==0 & idate!=.

	global good10_pre0 if inrange(reldate,-10,10) & idate!=.

	global good10_pre14 if inrange(reldate,-10,10) & pretreat14==0 & idate!=.

	global good10_pre21 if inrange(reldate,-10,10) & pretreat21==0 & idate!=.

	global good10_pre30 if inrange(reldate,-10,10) & pretreat30==0 & idate!=.
}



***********************************************************************
******************************MAIN TEXT********************************
***********************************************************************


*************************************************
*Figure 1: Terrorist attacks in Spain, 1977-2008*
*************************************************

*See script "Replication_Fig1Map_script.R"



************************************************
*Table 1: Construction of dataset: Restrictions*
************************************************

quietly {
	gen n=_n
	
	egen checksingletons_event_r0=total(!missing(voteinc) & !missing(post) & !missing(same_reg2) & !missing(CIS_reg) & !missing(id)), by(event)
	egen checksingletons_reg_r0=total(!missing(voteinc) & !missing(post) & !missing(same_reg2) & !missing(event) & !missing(id)), by(CIS_reg)

	egen checksingletons_event_r1=total(!missing(voteinc) & !missing(post) & !missing(same_reg2) & !missing(CIS_reg) & !missing(id) & inrange(reldate,-30,30)), by(event)
	egen checksingletons_reg_r1=total(!missing(voteinc) & !missing(post) & !missing(same_reg2) & !missing(event) & !missing(id)), by(CIS_reg)

	egen checksingletons_event_r2=total(!missing(voteinc) & !missing(post) & !missing(same_reg2) & !missing(CIS_reg) & !missing(id) & inrange(reldate,-30,30) & pretreat7==0), by(event)
	egen checksingletons_reg_r2=total(!missing(voteinc) & !missing(post) & !missing(same_reg2) & !missing(event) & !missing(id) & inrange(reldate,-30,30) & pretreat7==0), by(CIS_reg)

	egen checksingletons_event_r3=total(!missing(voteinc) & !missing(post) & !missing(same_reg2) & !missing(CIS_reg) & !missing(id) & inrange(reldate,-30,30) & pretreat7==0 & good30==1), by(event)
	egen checksingletons_reg_r3=total(!missing(voteinc) & !missing(post) & !missing(same_reg2) & !missing(event) & !missing(id) & inrange(reldate,-30,30) & pretreat7==0 & good30==1), by(CIS_reg)
}

*Row 1
distinct eventnum estu ep_date n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & checksingletons_event_r0>1 & checksingletons_reg_r0>1
distinct n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & post==0
distinct n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & post==1

*Row 2
distinct eventnum estu ep_date n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & checksingletons_event_r1>1 & checksingletons_reg_r1>1 & inrange(reldate,-30,30)
distinct n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & checksingletons_event_r1>1 & checksingletons_reg_r1>1 & inrange(reldate,-30,30) & post==0
distinct n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & checksingletons_event_r1>1 & checksingletons_reg_r1>1 & inrange(reldate,-30,30) & post==1

*Row 3
distinct eventnum estu ep_date n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & checksingletons_event_r2>1 & checksingletons_reg_r2>1 & inrange(reldate,-30,30) & pretreat7==0
distinct n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & checksingletons_event_r2>1 & checksingletons_reg_r2>1 & inrange(reldate,-30,30) & pretreat7==0 & post==0
distinct n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & checksingletons_event_r2>1 & checksingletons_reg_r2>1 & inrange(reldate,-30,30) & pretreat7==0 & post==1

*Row 4
distinct eventnum estu ep_date n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & checksingletons_event_r3>1 & checksingletons_reg_r3>1 & inrange(reldate,-30,30) & pretreat7==0 & good30==1
distinct n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & checksingletons_event_r3>1 & checksingletons_reg_r3>1 & inrange(reldate,-30,30) & pretreat7==0 & good30==1 & post==0
distinct n if voteinc!=. & post!=. & same_reg2!=. & CIS_reg!=. & id!=. & event!="" & checksingletons_event_r3>1 & checksingletons_reg_r3>1 & inrange(reldate,-30,30) & pretreat7==0 & good30==1 & post==1



******************************************************
*Table 2: Effect of attacks on vote for the incumbent*
******************************************************

quietly {
	reghdfe voteinc i.post##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store inc1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store inc2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store inc3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store inc4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store inc5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store inc6
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store inc7
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store inc8
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store inc9
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store inc10
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
}

esttab inc*, replace noomitted label nonotes noobs nodepvar ///
 mtitles("{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3" "{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3") ///
 keep(1.post 1.same_reg2 1.post#1.same_reg2) ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(controls attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")


 
*******************************************************
*Table 3: Effect of attacks on vote for the opposition*
*******************************************************

quietly {
	reghdfe voteopp i.post##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store opp1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store opp2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store opp3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store opp4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store opp5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store opp6
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store opp7
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store opp8
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store opp9
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store opp10
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
}

esttab opp*, replace noomitted label nonotes noobs nodepvar ///
 mtitles("{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3" "{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3") ///
 keep(1.post 1.same_reg2 1.post#1.same_reg2) ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(controls attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")



******************************************************
*Figure 2: Marginal effects of attacks on vote choice*
******************************************************

quietly {

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(inc30, replace)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(inc20, replace)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(inc10, replace)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(inc5, replace)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(inc3, replace)

	combomarginsplot inc3 inc5 inc10 inc20 inc30, horiz labels("{&plusmn}3" "{&plusmn}5" "{&plusmn}10" "{&plusmn}20" "{&plusmn}30") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" " ", size(medium)) ytitle("Bandwidths") ///
	 yscale(range(0.5 5.5) titlegap(+1))  savefile(inc_same, replace)
	 
	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(inc30, replace)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(inc20, replace)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(inc10, replace)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(inc5, replace)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(inc3, replace)

	combomarginsplot inc3 inc5 inc10 inc20 inc30, horiz labels("{&plusmn}3" "{&plusmn}5" "{&plusmn}10" "{&plusmn}20" "{&plusmn}30") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" " ", size(medium)) ytitle("Bandwidths") ///
	 yscale(range(0.5 5.5) titlegap(+1))  savefile(inc_other, replace)

	combomarginsplot inc_other inc_same, horiz labels("Another region" "Same region") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle(" ", size(small)) xscale(titlegap(0))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" " ", size(medium) pos(12)) ytitle("Bandwidths") ///
	 file1opts(mcolor(538b)) file2opts(mcolor(538r)) fileci1opts(lcolor(538b)) fileci2opts(lcolor(538r))  ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 yscale(range(0.5 5.5) titlegap(+1)) offset(0.2)
	graph save combo_inc_hor_tocomb.gph, replace
	

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(opp30, replace)

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(opp20, replace)

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(opp10, replace)

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(opp5, replace)

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(opp3, replace)

	combomarginsplot opp3 opp5 opp10 opp20 opp30, horiz labels("{&plusmn}3" "{&plusmn}5" "{&plusmn}10" "{&plusmn}20" "{&plusmn}30") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the opposition", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the opposition" " ", size(medium)) ytitle("Bandwidths") ///
	 yscale(range(0.5 5.5) titlegap(+1))  savefile(opp_same, replace)
	 	 
	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(opp30, replace)

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(opp20, replace)

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(opp10, replace)

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(opp5, replace)

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(opp3, replace)

	combomarginsplot opp3 opp5 opp10 opp20 opp30, horiz labels("{&plusmn}3" "{&plusmn}5" "{&plusmn}10" "{&plusmn}20" "{&plusmn}30") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the opposition", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the opposition" " ", size(medium)) ytitle("Bandwidths") ///
	 yscale(range(0.5 5.5) titlegap(+1))  savefile(opp_other, replace)
 
	combomarginsplot opp_other opp_same, horiz labels("Another region" "Same region") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle(" ", size(small)) xscale(titlegap(0))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the opposition" " ", size(medium) pos(12)) ytitle("Bandwidths") ///
	 file1opts(mcolor(538b)) file2opts(mcolor(538r)) fileci1opts(lcolor(538b)) fileci2opts(lcolor(538r))  ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 yscale(range(0.5 5.5) titlegap(+1)) offset(0.2)
	graph save combo_opp_hor_tocomb.gph, replace
}

grc1leg combo_inc_hor_tocomb.gph combo_opp_hor_tocomb.gph, col(2) ycommon xcommon imargin(tiny) pos(6)
graph export figure_2.pdf, replace



*********************************************************************
*Figure 3: Marginal effects of attacks, by target (10-day bandwidth)*
*********************************************************************

quietly {
	reghdfe voteinc i.post##i.same_reg_gtd##i.GTD_target $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(GTD_target=(1 2 3) same_reg_gtd=(1 0)) noestimcheck
	mplotoffset , horiz recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle(" ", size(small)) xscale(titlegap(0))  ///
	 ytitle(" ", size(small))  ///
	 xlabel(-.2(0.05).2, labsize(small)) ///
	 title("Vote for the incumbent" " ", size(medium) pos(12)) ///
	 yscale(range(0.5 3.5)) ylabel(1 "Military/Police" 2"Public Officials" 3 "Civilians", angle(vertical) labsize(small)) ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 plot1opts(mcolor(538b)) ci1opts(lcolor(538b)) plot2opts(mcolor(538r)) ci2opts(lcolor(538r)) offset(0.1)
	graph save target_inc_tocomb.gph, replace

	reghdfe voteopp i.post##i.same_reg_gtd##i.GTD_target $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(GTD_target=(1 2 3) same_reg_gtd=(1 0)) noestimcheck
	mplotoffset , horiz recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle(" ", size(small)) xscale(titlegap(0))  ///
	 ytitle(" ", size(small))  ///
	 xlabel(-.2(0.05).2, labsize(small)) ///
	 title("Vote for the opposition" " ", size(medium) pos(12)) ///
	 yscale(range(0.5 3.5)) ylabel(1 "Military/Police" 2"Public Officials" 3 "Civilians", angle(vertical) labsize(small)) ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 plot1opts(mcolor(538b)) ci1opts(lcolor(538b)) plot2opts(mcolor(538r)) ci2opts(lcolor(538r)) offset(0.1)
	graph save target_opp_tocomb.gph, replace
}

grc1leg target_inc_tocomb.gph target_opp_tocomb.gph, col(2) ycommon xcommon imargin(tiny) pos(6)
graph export figure_3.pdf, replace



**********************************************************************************************
*Figure 4: Marginal effects of attacks on vote for right-wing vs left-wing state-wide parties*
**********************************************************************************************

quietly {
	
	reghdfe voterightvsleft_swp i.post##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(RIGHTvsLEFT10_t_nc, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(RIGHTvsLEFT10_c_nc, replace)

	reghdfe voterightvsleft_swp i.post##i.same_reg2 $controlsint_relevant $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(RIGHTvsLEFT10_t_wc, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(RIGHTvsLEFT10_c_wc, replace)


	combomarginsplot RIGHTvsLEFT10_t_nc RIGHTvsLEFT10_t_wc, horiz labels("No controls" "With controls") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for right-wing vs left-wing party", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for PP vs PSOE" " ", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(RIGHTvsLEFT_t, replace)
	 
	combomarginsplot RIGHTvsLEFT10_c_nc RIGHTvsLEFT10_c_wc, horiz labels("No controls" "With controls") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for right-wing vs left-wing party", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for PP vs PSOE" " ", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(RIGHTvsLEFT_c, replace)

}

combomarginsplot RIGHTvsLEFT_c RIGHTvsLEFT_t, horiz labels("Another region" "Same region") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
 xtitle(" ", size(small)) xscale(titlegap(0))  ///
 xlabel(-.1(0.02).1, labsize(small)) ///
 title("Vote for RIGHT vs LEFT" " ", size(medium) pos(12)) ytitle("") ///
 file1opts(mcolor(538b)) file2opts(mcolor(538r)) fileci1opts(lcolor(538b)) fileci2opts(lcolor(538r))  ///
 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
 yscale(range(0.5 2.5) titlegap(+1)) offset(0.2)
graph export figure_4.pdf, replace



*************************************************************************************
*Figure 5: Marginal effects of attacks on vote for the incumbent, by incumbent party*
*************************************************************************************

quietly {
	
	reghdfe voteinc i.post##i.same_reg2##i.incumbent3num $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1) incumbent3num=(2)) noestimcheck saving(PSOEinc10_t_nc, replace)
	margins , dydx(post) at(same_reg2=(0) incumbent3num=(2)) noestimcheck saving(PSOEinc10_c_nc, replace)
	margins , dydx(post) at(same_reg2=(1) incumbent3num=(1)) noestimcheck saving(PPinc10_t_nc, replace)
	margins , dydx(post) at(same_reg2=(0) incumbent3num=(1)) noestimcheck saving(PPinc10_c_nc, replace)

	reghdfe voteinc i.post##i.same_reg2##i.incumbent3num $controlsint_relevant $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1) incumbent3num=(2)) noestimcheck saving(PSOEinc10_t_wc, replace)
	margins , dydx(post) at(same_reg2=(0) incumbent3num=(2)) noestimcheck saving(PSOEinc10_c_wc, replace)
	margins , dydx(post) at(same_reg2=(1) incumbent3num=(1)) noestimcheck saving(PPinc10_t_wc, replace)
	margins , dydx(post) at(same_reg2=(0) incumbent3num=(1)) noestimcheck saving(PPinc10_c_wc, replace)


	combomarginsplot PSOEinc10_t_nc PSOEinc10_t_wc, horiz labels(`" "No" "controls" "' `" "With" "controls" "') recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(PSOE incumbency)", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(PSOEinc10_t, replace)
	 
	combomarginsplot PSOEinc10_c_nc PSOEinc10_c_wc, horiz labels(`" "No" "controls" "' `" "With" "controls" "') recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(PSOE incumbency)", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(PSOEinc10_c, replace)
	 

	combomarginsplot PSOEinc10_c PSOEinc10_t, horiz labels("Another region" "Same region") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle(" ", size(small)) xscale(titlegap(0))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(PSOE incumbency)", size(medium) pos(12)) ytitle("") ///
	 file1opts(mcolor(538b)) file2opts(mcolor(538r)) fileci1opts(lcolor(538b)) fileci2opts(lcolor(538r))  ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 yscale(range(0.5 2.5) titlegap(+1)) offset(0.2)
	graph save PSOEinc10.gph, replace


	combomarginsplot PPinc10_t_nc PPinc10_t_wc, horiz labels(`" "No" "controls" "' `" "With" "controls" "') recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(PP incumbency)", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(PPinc10_t, replace)
	 
	combomarginsplot PPinc10_c_nc PPinc10_c_wc, horiz labels(`" "No" "controls" "' `" "With" "controls" "') recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(PP incumbency)", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(PPinc10_c, replace)
	 

	combomarginsplot PPinc10_c PPinc10_t, horiz labels("Another region" "Same region") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle(" ", size(small)) xscale(titlegap(0))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(PP incumbency)", size(medium) pos(12)) ytitle("") ///
	 file1opts(mcolor(538b)) file2opts(mcolor(538r)) fileci1opts(lcolor(538b)) fileci2opts(lcolor(538r))  ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 yscale(range(0.5 2.5) titlegap(+1)) offset(0.2)
	graph save PPinc10.gph, replace

}

grc1leg PSOEinc10.gph PPinc10.gph, col(2) ycommon xcommon imargin(tiny) pos(6)
graph export figure_5.pdf, replace



******************************************
*Table 4: Effects on intention to abstain*
******************************************

quietly {
	
	reghdfe voteabs i.post##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store abs1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store abs2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store abs3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store abs4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store abs5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store abs6
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store abs7
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store abs8
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store abs9
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store abs10
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

}

esttab abs*, replace noomitted label nonotes noobs nodepvar ///
 mtitles("{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3" "{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3") ///
 keep(1.post 1.same_reg2 1.post#1.same_reg2) ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(controls attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")



**************************************
*Figure 6: Priming experiment results*
**************************************

use surveyexperiment_terror_data.dta, clear

quietly {
*net install catcibar /*install if needed*/
}

catcibar rally, proportion over(tprime) ytitle("Percent") plotregion(lstyle(none)) ylabel(, gstyle(dot)) xlabel(, nogrid) legend(order(2 "Treatment" 1 "Control")) scheme(538w) /*needs manual edition of the yaxis*/
graph export figure_6.pdf, replace




************************************************************************
********************************APPENDIX********************************
************************************************************************

use multipleuesd_terror_data.dta, clear

*******************************************
*Table B1: UESD balance table (+/-30 days)*
*******************************************

*Columns 1-6

quietly {
	iebaltab gender age edurec laborrec_* sizemunrec_* if good30==1, grpvar(post) control(0) fixedeffect(eventnum) rowvarlab stats(pair(diff)) star(.05 .01 .001) browse
}

browse v1-v5 v7

*Column 7 (transposed)

use multipleuesd_terror_data.dta, clear

quietly {
	reghdfe gender i.post##i.same_reg2 if good30==1, absorb(event)
	est store did1

	reghdfe age i.post##i.same_reg2 if good30==1, absorb(event)
	est store did2

	reghdfe edurec i.post##i.same_reg2 if good30==1, absorb(event)
	est store did3

	reghdfe laborrec_1 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did4

	reghdfe laborrec_2 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did5

	reghdfe laborrec_3 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did6

	reghdfe laborrec_4 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did7

	reghdfe laborrec_5 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did8

	reghdfe sizemunrec_1 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did9

	reghdfe sizemunrec_2 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did10

	reghdfe sizemunrec_3 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did11

	reghdfe sizemunrec_4 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did12

	reghdfe sizemunrec_5 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did13

	reghdfe sizemunrec_6 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did14

	reghdfe sizemunrec_7 i.post##i.same_reg2 if good30==1, absorb(event)
	est store did15
}

esttab did*, keep(1.post#1.same_reg2) label nonotes noobs cells("b(fmt(%9.3f) star)")



****************************************************************************
*Table C1: Effect of attacks on vote for the incumbent (full model results)*
****************************************************************************

quietly {
	reghdfe voteinc i.post##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store inc1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store inc2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store inc3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store inc4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store inc5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store inc6
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store inc7
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store inc8
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store inc9
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store inc10
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
}

esttab inc*, replace noomitted label nonotes noobs nodepvar nobase ///
 mtitles("{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3" "{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3") ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(controls attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")



*****************************************************************************
*Table C2: Effect of attacks on vote for the opposition (full model results)*
*****************************************************************************

quietly {
	reghdfe voteopp i.post##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store opp1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store opp2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store opp3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store opp4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store opp5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store opp6
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store opp7
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store opp8
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store opp9
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store opp10
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
}

esttab opp*, replace noomitted label nonotes noobs nodepvar nobase ///
 mtitles("{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3" "{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3") ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(controls attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")



**********************************************************************************************************
*Table C3: Effect of attacks on vote for the incumbent and the opposition, by target (full model results)*
**********************************************************************************************************

quietly {
	reghdfe voteinc i.post##i.same_reg_gtd##i.GTD_target $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store target1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteopp i.post##i.same_reg_gtd##i.GTD_target $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store target2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
}

esttab target1 target2, replace noomitted label nonotes noobs nodepvar ///
 drop(0.*  1.GTD_target) ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")



**************************************************************************
*Table C4: Effect of attacks on intention to abstain (full model results)*
**************************************************************************

quietly {	
	reghdfe voteabs i.post##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store abs1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store abs2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store abs3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store abs4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store abs5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store abs6
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store abs7
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store abs8
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store abs9
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteabs i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store abs10
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

}

esttab abs*, replace noomitted label nonotes noobs nodepvar nobase ///
 mtitles("{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3" "{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3") ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(controls attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")


 
*********************************************************************************
*Table D1: Effects on vote for the incumbent with different pretreatment windows*
*********************************************************************************

quietly {
	reghdfe voteinc i.post##i.same_reg2 $good10_pre0 & good10_pre0==1, absorb(event CIS_reg) cluster(id)
	est store pretreat1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	sum post if e(sample) & post==0
	estadd local n_pre = r(N)

	reghdfe voteinc i.post##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store pretreat2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	sum post if e(sample) & post==0
	estadd local n_pre = r(N)

	reghdfe voteinc i.post##i.same_reg2 $good10_pre14 & good10==1, absorb(event CIS_reg) cluster(id)
	est store pretreat3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	sum post if e(sample) & post==0
	estadd local n_pre = r(N)

	reghdfe voteinc i.post##i.same_reg2 $good10_pre21 & good10==1, absorb(event CIS_reg) cluster(id)
	est store pretreat4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	sum post if e(sample) & post==0
	estadd local n_pre = r(N)

	reghdfe voteinc i.post##i.same_reg2 $good10_pre30 & good10==1, absorb(event CIS_reg) cluster(id)
	est store pretreat5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	sum post if e(sample) & post==0
	estadd local n_pre = r(N)


	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre0 & good10_pre0==1, absorb(event CIS_reg) cluster(id)
	est store pretreat6
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	sum post if e(sample) & post==0
	estadd local n_pre = r(N)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store pretreat7
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	sum post if e(sample) & post==0
	estadd local n_pre = r(N)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre14 & good10==1, absorb(event CIS_reg) cluster(id)
	est store pretreat8
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	sum post if e(sample) & post==0
	estadd local n_pre = r(N)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre21 & good10==1, absorb(event CIS_reg) cluster(id)
	est store pretreat9
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	sum post if e(sample) & post==0
	estadd local n_pre = r(N)

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre30 & good10==1, absorb(event CIS_reg) cluster(id)
	est store pretreat10
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	sum post if e(sample) & post==0
	estadd local n_pre = r(N)
}

esttab pretreat*, replace noomitted label nonotes noobs nodepvar ///
 mtitles("No" "1w" "2w" "3w" "1m" "No" "1w" "2w" "3w" "1m") ///
 keep(1.post 1.same_reg2 1.post#1.same_reg2) ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(controls attack_fe reg_fe N n_pre n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. in control" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")



***********************************************************************************************************
*Table D2: Effect of attacks on vote for the incumbent (excluding surveys of incumbent transition periods)*
***********************************************************************************************************

quietly {
	reghdfe voteinc i.post##i.same_reg2 $good30_pre7 & good30==1 & incumbent_startfield==incumbent_endfield, absorb(event CIS_reg) cluster(id)
	est store incnotrans1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 


	reghdfe voteinc i.post##i.same_reg2 $good20_pre7 & good20==1 & incumbent_startfield==incumbent_endfield, absorb(event CIS_reg) cluster(id)
	est store incnotrans2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good10_pre7 & good10==1 & incumbent_startfield==incumbent_endfield, absorb(event CIS_reg) cluster(id)
	est store incnotrans3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good5_pre7 & good5==1 & incumbent_startfield==incumbent_endfield, absorb(event CIS_reg) cluster(id)
	est store incnotrans4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good3_pre7 & good3==1 & incumbent_startfield==incumbent_endfield, absorb(event CIS_reg) cluster(id)
	est store incnotrans5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 


	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1 & incumbent_startfield==incumbent_endfield, absorb(event CIS_reg) cluster(id)
	est store incnotrans6
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1 & incumbent_startfield==incumbent_endfield, absorb(event CIS_reg) cluster(id)
	est store incnotrans7
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1 & incumbent_startfield==incumbent_endfield, absorb(event CIS_reg) cluster(id)
	est store incnotrans8
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1 & incumbent_startfield==incumbent_endfield, absorb(event CIS_reg) cluster(id)
	est store incnotrans9
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1 & incumbent_startfield==incumbent_endfield, absorb(event CIS_reg) cluster(id)
	est store incnotrans10
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)'
}

esttab incnotrans*, replace noomitted label nonotes noobs nodepvar ///
 mtitles("{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3" "{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3") ///
 keep(1.post 1.same_reg2 1.post#1.same_reg2) ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(controls attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")



****************************************************************
*Table D3: Effects on non-responses (Don't Knows / No Opinions)*
****************************************************************

quietly {
	reghdfe votedk i.post##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store dk1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe votedk i.post##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store dk2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe votedk i.post##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store dk3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe votedk i.post##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store dk4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe votedk i.post##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store dk5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe votedk i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good30_pre7 & good30==1, absorb(event CIS_reg) cluster(id)
	est store dk6
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe votedk i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good20_pre7 & good20==1, absorb(event CIS_reg) cluster(id)
	est store dk7
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe votedk i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	est store dk8
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe votedk i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good5_pre7 & good5==1, absorb(event CIS_reg) cluster(id)
	est store dk9
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe votedk i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good3_pre7 & good3==1, absorb(event CIS_reg) cluster(id)
	est store dk10
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
}

esttab dk*, replace noomitted label nonotes noobs nodepvar ///
 mtitles("{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3" "{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3") ///
 keep(1.post 1.same_reg2 1.post#1.same_reg2) ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(controls attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")



********************************************************************************
*Table D4: Placebo treatment effects on vote for the incumbent against baseline*
********************************************************************************

quietly {
	gen post_min25=(reldate>-25)
	gen post_min20=(reldate>-20)
	gen post_min15=(reldate>-15)
	gen post_min10=(reldate>-10)
	gen post_min9=(reldate>-9)
	gen post_min8=(reldate>-8)
	gen post_min7=(reldate>-7)
	gen post_min6=(reldate>-6)
	gen post_min5=(reldate>-5)
	gen post_min4=(reldate>-4)
	gen post_min3=(reldate>-3)
	gen post_min2=(reldate>-2)

	gen post_plac=post_min8
	reghdfe voteinc i.post_plac##i.same_reg2 if inrange(reldate,-10,-5) & pretreat7==0 & idate!=. & good30==1 & post==0, absorb(event CIS_reg) cluster(id)
	est store plac1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	drop post_plac

	gen post_plac=post_min6
	reghdfe voteinc i.post_plac##i.same_reg2 if inrange(reldate,-8,-3) & pretreat7==0 & idate!=. & good30==1 & post==0, absorb(event CIS_reg) cluster(id)
	est store plac2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	drop post_plac

	gen post_plac=post_min4
	reghdfe voteinc i.post_plac##i.same_reg2 if inrange(reldate,-6,-1) & pretreat7==0 & idate!=. & good30==1 & post==0, absorb(event CIS_reg) cluster(id)
	est store plac3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	drop post_plac

	gen post_plac=post
	reghdfe voteinc i.post_plac##i.same_reg2 if inrange(reldate,-3,3) & pretreat7==0 & idate!=. & good3==1, absorb(event CIS_reg) cluster(id)
	est store base1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	drop post_plac

	gen post_plac=post_min8
	reghdfe voteinc i.post_plac##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 if inrange(reldate,-10,-5) & pretreat7==0 & idate!=. & good30==1 & post==0, absorb(event CIS_reg) cluster(id)
	est store plac4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	drop post_plac

	gen post_plac=post_min6
	reghdfe voteinc i.post_plac##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 if inrange(reldate,-8,-3) & pretreat7==0 & idate!=. & good30==1 & post==0, absorb(event CIS_reg) cluster(id)
	est store plac5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	drop post_plac

	gen post_plac=post_min4
	reghdfe voteinc i.post_plac##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 if inrange(reldate,-6,-1) & pretreat7==0 & idate!=. & good30==1 & post==0, absorb(event CIS_reg) cluster(id)
	est store plac6
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	drop post_plac

	gen post_plac=post
	reghdfe voteinc i.post_plac##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 if inrange(reldate,-3,3) & pretreat7==0 & idate!=. & good3==1, absorb(event CIS_reg) cluster(id)
	est store base2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "Yes"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
	drop post_plac
	
	drop post_min*
}

esttab plac1 plac2 plac3 base1 plac4 plac5 plac6 base2, replace noomitted label nonotes noobs nodepvar ///
 mtitles("-7" "-5" "-3" "base" "-7" "-5" "-3" "base") ///
 keep(1.post_plac 1.same_reg2 1.post_plac#1.same_reg2) ///
 coeflabels(1.post_plac "Post" 1.same_reg2 "Same region" 1.post_plac#1.same_reg2 "Post * Region") ///
 b(%9.2f) se(%9.2f) ///
 stats(controls attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")



***************************************************************************
*Table D5: Effect of attacks on vote for the incumbent (entropy balancing)*
***************************************************************************

quietly {
	ebalance post i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 if good30==1, generate(weights_ebalance_int30) target(3) maxit(20)
	ebalance post i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 if good20==1, generate(weights_ebalance_int20) target(3) maxit(20)
	ebalance post i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 if good10==1, generate(weights_ebalance_int10) target(3) maxit(20)
	ebalance post i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 if good5==1, generate(weights_ebalance_int5) target(3) maxit(20)
	ebalance post i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 if good3==1, generate(weights_ebalance_int3) target(3) maxit(20)

	reghdfe voteinc i.post##i.same_reg2 $good30_pre7 & good30==1 [pweight=weights_ebalance_int30], absorb(event CIS_reg) cluster(id)
	est store match1
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good20_pre7 & good20==1 [pweight=weights_ebalance_int20], absorb(event CIS_reg) cluster(id)
	est store match2
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good10_pre7 & good10==1 [pweight=weights_ebalance_int10], absorb(event CIS_reg) cluster(id)
	est store match3
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good5_pre7 & good5==1 [pweight=weights_ebalance_int5], absorb(event CIS_reg) cluster(id)
	est store match4
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 

	reghdfe voteinc i.post##i.same_reg2 $good3_pre7 & good3==1 [pweight=weights_ebalance_int3], absorb(event CIS_reg) cluster(id)
	est store match5
	estadd local attack_fe "Yes"
	estadd local reg_fe "Yes"
	estadd local controls "No"
	estadd local n = e(N)
	estadd local n_event_survey = e(df_a_initial) - 19
	distinct estu if e(sample)
	estadd local n_surveys = `r(ndistinct)'
	distinct ep_date if e(sample)
	estadd local n_attacks = `r(ndistinct)' 
}

esttab match*, replace noomitted label nonotes noobs nodepvar ///
 mtitles("{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3" "{&plusmn}30" "{&plusmn}20" "{&plusmn}10" "{&plusmn}5" "{&plusmn}3") ///
 keep(1.post 1.same_reg2 1.post#1.same_reg2) ///
 coeflabels(1.post "Post" 1.same_reg2 "Target region" 1.post#1.same_reg2 "Post * Target") ///
 b(%9.2f) se(%9.2f) ///
 stats(attack_fe reg_fe N n_event_survey n_surveys n_attacks, label("Controls" "Attack FE" "Region FE" "N. of respondents" "N. of UESDs" "N. of surveys" "N. of attacks") fmt(%12.0gc)) ///
 addnotes("Standard errors in parentheses" "\sym{*} \(p<.05\), \sym{**} \(p<.01\), \sym{***} \(p<.001\).")



***************************************************************************
*Figure D1: Marginal effects of attacks on vote choice (entropy balancing)*
***************************************************************************

quietly {
	reghdfe voteinc i.post##i.same_reg2 $good30_pre7 & good30==1 [pweight=weights_ebalance_int30], absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(match30_t, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(match30_c, replace)

	reghdfe voteinc i.post##i.same_reg2 $good20_pre7 & good20==1 [pweight=weights_ebalance_int20], absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(match20_t, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(match20_c, replace)

	reghdfe voteinc i.post##i.same_reg2 $good10_pre7 & good10==1 [pweight=weights_ebalance_int10], absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(match10_t, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(match10_c, replace)

	reghdfe voteinc i.post##i.same_reg2 $good5_pre7 & good5==1 [pweight=weights_ebalance_int5], absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(match5_t, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(match5_c, replace)

	reghdfe voteinc i.post##i.same_reg2 $good3_pre7 & good3==1 [pweight=weights_ebalance_int3], absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(match3_t, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(match3_c, replace)

	drop weights_ebalance_*

	combomarginsplot match30_t match20_t match10_t match5_t match3_t, horiz labels("{&plusmn}3" "{&plusmn}5" "{&plusmn}10" "{&plusmn}20" "{&plusmn}30") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" " ", size(medium)) ytitle("Bandwidths") ///
	 yscale(range(0.5 5.5) titlegap(+1))  savefile(match_same, replace)
	 
	combomarginsplot match30_c match20_c match10_c match5_c match3_c, horiz labels("{&plusmn}3" "{&plusmn}5" "{&plusmn}10" "{&plusmn}20" "{&plusmn}30") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" " ", size(medium)) ytitle("Bandwidths") ///
	 yscale(range(0.5 5.5) titlegap(+1))  savefile(match_other, replace)
}

combomarginsplot match_other match_same, horiz labels("Another region" "Same region") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
 xtitle(" ", size(small)) xscale(titlegap(0))  ///
 xlabel(-.1(0.02).1, labsize(small)) ///
 title("Vote for the incumbent" " ", size(medium) pos(12)) ytitle("Bandwidths") ///
 file1opts(mcolor(538b)) file2opts(mcolor(538r)) fileci1opts(lcolor(538b)) fileci2opts(lcolor(538r))  ///
 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
 yscale(range(0.5 5.5) titlegap(+1)) offset(0.2)



********************************************************************************
*Table D6: Effect of false attacks on vote for the incumbent (5 randomizations)*
********************************************************************************

*See script "Replication_sectionD6.do"



**********************************************************************************
*Table D7: Effect of false attacks on vote for the incumbent (100 randomizations)*
**********************************************************************************

*See script "Replication_sectionD6.do"



*******************************
*Figure E1: Day-by-day results*
*******************************

quietly {
	reghdfe voteinc b29.reldateref30##i.same_reg2 if inrange(reldate,-30,30) & pretreat7==0 & idate!=. & good30==1, absorb(event CIS_reg) cluster(id)
	margins , at(reldateref30=(23(1)36) same_reg2=(0)) noestimcheck nose saving(pred_other_all, replace)
	margins , at(reldateref30=(23(1)36) same_reg2=(1)) noestimcheck nose saving(pred_same_all, replace)
	margins r.same_reg2 , at(reldateref30=(29 23 24 25 26 27 28 29 30 31 32 33 34 35 36)) contrast(atcontrast(r)) noestimcheck saving(did_all, replace)
	frame create did
	frame did: use did_all.dta, clear
	frame did: expand 2 if _at==3, gen(dup)
	frame did: recode _at (3=4) (4=5) if dup==0
	frame did: recode _margin _se_margin _statistic _pvalue _ci_lb _ci_ub (*=0) if dup==1
	frame did: replace _margin=0.0000000001 if dup==1
	frame did: replace _at1=29 if dup==1
	frame did: sort _at
}

combomarginsplot pred_other_all pred_same_all did_all, yline(0) xline(29.5, lpattern(solid) lcolor(black) lwidth(medium)) recastci(rspike) scheme(538w) ///
 plotopts(msize(medium)) ciopts(lwidth(medthick)) ///
 xtitle("Relative date of interview", size(small)) xscale(range(22.75 36.25) titlegap(+2))  ///
 ytitle("Predicted Incumbent Vote", size(small))  /// * xlabel(27 28 29, labsize(small)) ///
 title("", size(medium)) ///
 yscale(range(-.1 0.35) titlegap(+1)) ylabel(-.1(.1).3) ///
 legend(order(5 "Same region" 4 "Another region" 6 "DiD (wrt day -1)")) ///
 file1opts(mcolor(538b) lcolor(538b)) fileci1opts(lcolor(none)) file2opts(mcolor(538r) lcolor(538r)) fileci2opts(lcolor(none)) file3opts(mcolor(538g) lcolor(538g)) fileci3opts(lcolor(538g))  ///
 offset(0)
graph export figure_e1.pdf, replace

quietly {
	frame drop did
}



***************************************************************************************************************
*Figure F1: Marginal effects of attacks on vote for for the incumbent (excluding Basque Country and Catalonia)*
***************************************************************************************************************

quietly {

	*Excluding Basque Country
	reghdfe voteinc i.post##i.same_reg2 $good10_pre7 & good10==1 & ep_reg!=16, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(noBC_inc10_t_nc, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(noBC_inc10_c_nc, replace)
	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1 & ep_reg!=16, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(noBC_inc10_t_wc, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(noBC_inc10_c_wc, replace)
	combomarginsplot noBC_inc10_t_nc noBC_inc10_t_wc, horiz labels("No controls" "With controls") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(Excl. Basque Country)", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(noBC_inc_t, replace)
	combomarginsplot noBC_inc10_c_nc noBC_inc10_c_wc, horiz labels("No controls" "With controls") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(Excl. Basque Country)", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(noBC_inc_c, replace)
	combomarginsplot noBC_inc_c noBC_inc_t, horiz labels("Another region" "Same region") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle(" ", size(small)) xscale(titlegap(0))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(Excl. Basque Country)", size(medium) pos(12)) ytitle("") ///
	 file1opts(mcolor(538b)) file2opts(mcolor(538r)) fileci1opts(lcolor(538b)) fileci2opts(lcolor(538r))  ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 yscale(range(0.5 2.5) titlegap(+1)) offset(0.2)
	graph save noBC_inc.gph, replace

	*Excluding Catalonia
	reghdfe voteinc i.post##i.same_reg2 $good10_pre7 & good10==1 & ep_reg!=9, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(noCAT_inc10_t_nc, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(noCAT_inc10_c_nc, replace)
	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1 & ep_reg!=9, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(noCAT_inc10_t_wc, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(noCAT_inc10_c_wc, replace)
	combomarginsplot noCAT_inc10_t_nc noCAT_inc10_t_wc, horiz labels("No controls" "With controls") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(Excl. Catalonia)", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(noCAT_inc_t, replace)
	combomarginsplot noCAT_inc10_c_nc noCAT_inc10_c_wc, horiz labels("No controls" "With controls") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(Excl. Catalonia)", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(noCAT_inc_c, replace)
	combomarginsplot noCAT_inc_c noCAT_inc_t, horiz labels("Another region" "Same region") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle(" ", size(small)) xscale(titlegap(0))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(Excl. Catalonia)", size(medium) pos(12)) ytitle("") ///
	 file1opts(mcolor(538b)) file2opts(mcolor(538r)) fileci1opts(lcolor(538b)) fileci2opts(lcolor(538r))  ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 yscale(range(0.5 2.5) titlegap(+1)) offset(0.2)
	graph save noCAT_inc.gph, replace

	*Excluding Basque Country & Catalonia
	reghdfe voteinc i.post##i.same_reg2 $good10_pre7 & good10==1 & ep_reg!=16 & ep_reg!=9, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(noBCnoCAT_inc10_t_nc, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(noBCnoCAT_inc10_c_nc, replace)
	reghdfe voteinc i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1 & ep_reg!=16 & ep_reg!=9, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(noBCnoCAT_inc10_t_wc, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(noBCnoCAT_inc10_c_wc, replace)
	combomarginsplot noBCnoCAT_inc10_t_nc noBCnoCAT_inc10_t_wc, horiz labels("No controls" "With controls") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(Excl. Basque Country & Catalonia)", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(noBCnoCAT_inc_t, replace)
	combomarginsplot noBCnoCAT_inc10_c_nc noBCnoCAT_inc10_c_wc, horiz labels("No controls" "With controls") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(Excl. Basque Country & Catalonia)", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(noBCnoCAT_inc_c, replace)
	combomarginsplot noBCnoCAT_inc_c noBCnoCAT_inc_t, horiz labels("Another region" "Same region") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle(" ", size(small)) xscale(titlegap(0))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for the incumbent" "(Excl. Basque Country & Catalonia)", size(medium) pos(12)) ytitle("") ///
	 file1opts(mcolor(538b)) file2opts(mcolor(538r)) fileci1opts(lcolor(538b)) fileci2opts(lcolor(538r))  ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 yscale(range(0.5 2.5) titlegap(+1)) offset(0.2)
	graph save noBCnoCAT_inc.gph, replace

}

grc1leg noBC_inc.gph noCAT_inc.gph noBCnoCAT_inc.gph, col(3) ycommon xcommon imargin(tiny) pos(6)
graph export figure_f1.pdf, replace



*****************************************************************************************
*Figure F2: Marginal effects of attacks on vote for state-wide vs non-state-wide parties*
*****************************************************************************************

quietly {
	reghdfe voteswp i.post##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(swp10_t_nc, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(swp10_c_nc, replace)

	reghdfe voteswp i.post##i.same_reg2 i.gender c.age c.agesq c.edurec i.laborrec##i.same_reg2 i.sizemunrec##i.same_reg2 $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(same_reg2=(1)) noestimcheck saving(swp10_t_wc, replace)
	margins , dydx(post) at(same_reg2=(0)) noestimcheck saving(swp10_c_wc, replace)

	combomarginsplot swp10_t_nc swp10_t_wc, horiz labels("No controls" "With controls") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for a SWP party", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for a SWP" " ", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(swp_t, replace)
	 
	combomarginsplot swp10_c_nc swp10_c_wc, horiz labels("No controls" "With controls") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 xtitle("Marginal effects of attack on vote for a SWP party", size(small)) xscale(titlegap(+2))  ///
	 xlabel(-.1(0.02).1, labsize(small)) ///
	 title("Vote for a SWP" " ", size(medium)) ytitle("") ///
	 yscale(range(0.5 2.5) titlegap(+1))  savefile(swp_c, replace)

}

combomarginsplot swp_c swp_t, horiz labels("Another region" "Same region") recast(scatter) recastci(rspike) xline(0) scheme(538w) ///
 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
 xtitle(" ", size(small)) xscale(titlegap(0))  ///
 xlabel(-.1(0.02).1, labsize(small)) ///
 title("Vote for a SWP" " ", size(medium) pos(12)) ytitle("") ///
 file1opts(mcolor(538b)) file2opts(mcolor(538r)) fileci1opts(lcolor(538b)) fileci2opts(lcolor(538r))  ///
 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
 yscale(range(0.5 2.5) titlegap(+1)) offset(0.2)
graph export figure_f2.pdf, replace

 

****************************************************************************
*Figure F3: Marginal effects of attacks on vote for incumbent, by lethality*
****************************************************************************

quietly {
	reghdfe voteinc i.post##i.same_reg_gtd##c.GTD_deaths $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(GTD_deaths=(0(1)6) same_reg_gtd=(1)) noestimcheck saving(severity_t_nc, replace)
	margins , dydx(post) at(GTD_deaths=(0(1)6) same_reg_gtd=(0)) noestimcheck saving(severity_c_nc, replace)
	combomarginsplot severity_c_nc severity_t_nc, labels("Another region" "Same region") recastci(rspike) yline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 ytitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xtitle("Number of lethal victims in the attack", size(small)) xscale(titlegap(+2))  ///
	 xlabel(0(1)6, labsize(small)) ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 title("No controls", size(medium) pos(12)) offset(.1)
	graph save severity_nc.gph, replace

	reghdfe voteinc i.post##i.same_reg_gtd##c.GTD_deaths $controlsint_relevant $good10_pre7 & good10==1, absorb(event CIS_reg) cluster(id)
	margins , dydx(post) at(GTD_deaths=(0(1)6) same_reg_gtd=(1)) noestimcheck saving(severity_t_wc, replace)
	margins , dydx(post) at(GTD_deaths=(0(1)6) same_reg_gtd=(0)) noestimcheck saving(severity_c_wc, replace)
	combomarginsplot severity_c_wc severity_t_wc, labels("Another region" "Same region") recastci(rspike) yline(0) scheme(538w) ///
	 plotopts(msize(medlarge)) ciopts(lwidth(thick)) ///
	 ytitle("Marginal effects of attack on vote for the incumbent", size(small)) xscale(titlegap(+2))  ///
	 xtitle("Number of lethal victims in the attack", size(small)) xscale(titlegap(+2))  ///
	 xlabel(0(1)6, labsize(small)) ///
	 legend(order(4 "Same region" 3 "Another region") row(1) pos(6)) ///
	 title("With controls", size(medium) pos(12)) offset(.1)
	graph save severity_wc.gph, replace
}

grc1leg severity_nc.gph severity_wc.gph, col(2) ycommon xcommon imargin(tiny)
graph export figure_f3.pdf, replace



quietly {
	***************************
	*Erase intermiediate files*
	***************************
	erase combo_inc_hor_tocomb.gph
	erase combo_opp_hor_tocomb.gph
	erase did_all.dta
	erase inc_other.dta
	erase inc_same.dta
	erase inc10.dta
	erase inc20.dta
	erase inc3.dta
	erase inc30.dta
	erase inc5.dta
	erase match_other.dta
	erase match_same.dta
	erase match10_c.dta
	erase match10_t.dta
	erase match20_c.dta
	erase match20_t.dta
	erase match3_c.dta
	erase match3_t.dta
	erase match30_c.dta
	erase match30_t.dta
	erase match5_c.dta
	erase match5_t.dta
	erase noBC_inc.gph
	erase noBC_inc_c.dta
	erase noBC_inc_t.dta
	erase noBC_inc10_c_nc.dta
	erase noBC_inc10_c_wc.dta
	erase noBC_inc10_t_nc.dta
	erase noBC_inc10_t_wc.dta
	erase noBCnoCAT_inc.gph
	erase noBCnoCAT_inc_c.dta
	erase noBCnoCAT_inc_t.dta
	erase noBCnoCAT_inc10_c_nc.dta
	erase noBCnoCAT_inc10_c_wc.dta
	erase noBCnoCAT_inc10_t_nc.dta
	erase noBCnoCAT_inc10_t_wc.dta
	erase noCAT_inc.gph
	erase noCAT_inc_c.dta
	erase noCAT_inc_t.dta
	erase noCAT_inc10_c_nc.dta
	erase noCAT_inc10_c_wc.dta
	erase noCAT_inc10_t_nc.dta
	erase noCAT_inc10_t_wc.dta
	erase opp_other.dta
	erase opp_same.dta
	erase opp10.dta
	erase opp20.dta
	erase opp3.dta
	erase opp30.dta
	erase opp5.dta
	erase PPinc10.gph
	erase PPinc10_c.dta
	erase PPinc10_c_nc.dta
	erase PPinc10_c_wc.dta
	erase PPinc10_t.dta
	erase PPinc10_t_nc.dta
	erase PPinc10_t_wc.dta
	erase pred_other_all.dta
	erase pred_same_all.dta
	erase PSOEinc10.gph
	erase PSOEinc10_c.dta
	erase PSOEinc10_c_nc.dta
	erase PSOEinc10_c_wc.dta
	erase PSOEinc10_t.dta
	erase PSOEinc10_t_nc.dta
	erase PSOEinc10_t_wc.dta
	erase RIGHTvsLEFT_c.dta
	erase RIGHTvsLEFT_t.dta
	erase RIGHTvsLEFT10_c_nc.dta
	erase RIGHTvsLEFT10_c_wc.dta
	erase RIGHTvsLEFT10_t_nc.dta
	erase RIGHTvsLEFT10_t_wc.dta
	erase severity_c_nc.dta
	erase severity_c_wc.dta
	erase severity_nc.gph
	erase severity_t_nc.dta
	erase severity_t_wc.dta
	erase severity_wc.gph
	erase swp_c.dta
	erase swp_t.dta
	erase swp10_c_nc.dta
	erase swp10_c_wc.dta
	erase swp10_t_nc.dta
	erase swp10_t_wc.dta
	erase target_inc_tocomb.gph
	erase target_opp_tocomb.gph
}


log close

